package com.spsoft.vatoutinv.enums;

import lombok.Getter;

/**
 * Excel导入模板枚举类
 * 目前仅支持下载xlsx类型
 *
 * @author : chenxudong
 * @date : 2024/6/13 10:23
 */
@Getter
public enum ExcelDownloadEnum {

    EXCEL_MANUAL("0", "vmsManualInvoice.xlsx", "手工开票导入模板"),
    EXCEL_FULLOUT_INVOICE("1", "vmsFullOutInvoiceImport.xlsx", "已开发票管理导入模板"),
    EXCEL_FLOW_MATCH("2", "flowMatchingImport.xlsx", "交易流水匹配查询导入模板");

    /**
     * Excel导入模板种类代码
     */
    public String excelType;

    /**
     * Excel导入模板名称
     */
    public String excelName;

    /**
     * Excel导入模板返回用户的名称
     */
    public String fileName;

    ExcelDownloadEnum(String excelType, String excelName, String fileName) {
        this.excelType = excelType;
        this.excelName = excelName;
        this.fileName = fileName;
    }

    /**
     * 根据模板种类代码返回枚举类
     */
    public static ExcelDownloadEnum getEnumByExcelType(String excelType) {
        for (ExcelDownloadEnum e : ExcelDownloadEnum.values()) {
            if (e.getExcelType().equals(excelType)) {
                return e;
            }
        }
        return null;
    }
}
